using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("ScorePredicts")]
	[Serializable]
    public class ScorePredict : DBO<ScorePredict>
    {
		#region Fields
		
		private int? _IdScorePredict;
		private int? _IdMatch;
		private int? _IdUser;
		private int? _IdScore;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public ScorePredict()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdScorePredict 
		/// </summary>
		/// <param name="IdScorePredict">The IdScorePredict</param>
		public ScorePredict(int? IdScorePredict )
		{
			this.IdScorePredict = IdScorePredict;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdScorePredict">Sets int? value for IdScorePredict</param>
		/// <param name="IdMatch">Sets int? value for IdMatch</param>
		/// <param name="IdUser">Sets int? value for IdUser</param>
		/// <param name="IdScore">Sets int? value for IdScore</param>
		public ScorePredict(int? idScorePredict, int? idMatch, int? idUser, int? idScore)
		{
			this.IdScorePredict = idScorePredict;
			this.IdMatch = idMatch;
			this.IdUser = idUser;
			this.IdScore = idScore;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdScorePredict
		/// </summary>
		[ColumnAttribute("IdScorePredict", SqlDbType.Int , 4 , true, true, false)]
		public int? IdScorePredict
		{
			set
			{
				this._IdScorePredict = value;
			}
			get
			{
				return this._IdScorePredict;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdMatch
		/// </summary>
		[ColumnAttribute("IdMatch", SqlDbType.Int , 4 , false, false, true)]
		public int? IdMatch
		{
			set
			{
				this._IdMatch = value;
			}
			get
			{
				return this._IdMatch;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdUser
		/// </summary>
		[ColumnAttribute("IdUser", SqlDbType.Int , 4 , false, false, true)]
		public int? IdUser
		{
			set
			{
				this._IdUser = value;
			}
			get
			{
				return this._IdUser;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdScore
		/// </summary>
		[ColumnAttribute("IdScore", SqlDbType.Int , 4 , false, false, true)]
		public int? IdScore
		{
			set
			{
				this._IdScore = value;
			}
			get
			{
				return this._IdScore;
			}
		}
		
		
		/// <summary>
		/// Get a Match of current ScorePredict object base on IdMatch
		/// </summary>
		public Match Match
		{
			get
			{
				if (this.IdMatch == null)
					return null;
	
				Match condition = new Match(this.IdMatch);
				return MatchController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a Score of current ScorePredict object base on IdScore
		/// </summary>
		public Score Score
		{
			get
			{
				if (this.IdScore == null)
					return null;
	
				Score condition = new Score(this.IdScore);
				return ScoreController.FindItem(condition);
			}
		}
		
		/// <summary>
		/// Get a User of current ScorePredict object base on IdUser
		/// </summary>
		public User User
		{
			get
			{
				if (this.IdUser == null)
					return null;
	
				User condition = new User(this.IdUser);
				return UserController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdScorePredict]
            /// </summary>
            public string IdScorePredict
            {
                get
                {
                    return "IdScorePredict";
                }
            }
            /// <summary>
            /// Get the name of column [IdMatch]
            /// </summary>
            public string IdMatch
            {
                get
                {
                    return "IdMatch";
                }
            }
            /// <summary>
            /// Get the name of column [IdUser]
            /// </summary>
            public string IdUser
            {
                get
                {
                    return "IdUser";
                }
            }
            /// <summary>
            /// Get the name of column [IdScore]
            /// </summary>
            public string IdScore
            {
                get
                {
                    return "IdScore";
                }
            }
        }
        #endregion
    }
}
